package day05;
import java.util.Scanner;
public class Addition {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);

        int score=0;
        for(int i=1;i<=10;i++){

                int num=(int)(Math.random()*100);
                int nu=(int)(Math.random()*100);
                int resuly=nu+num;
            System.out.println("("+i+")"+nu+"+"+num+"=?");
            //出题
            System.out.println("算");

            int answer =scan.nextInt();
            //作答
            if(answer==resuly){
                System.out.println("对了");
                score +=10;
            }else{
                System.out.println("错了");
                System.out.println("正确答案为"+resuly);
            }
            //判断

        }
        System.out.println("最终成绩为："+score);
    }
}
